package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the DBOBJSECURITY database table.
 * 
 */
@Embeddable
public class DbobjsecurityPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String dbobjectname;
	private String methodcode;
	private String groupname;

    public DbobjsecurityPK() {
    }

	@Column(unique=true, nullable=false, length=80)
	public String getDbobjectname() {
		return this.dbobjectname;
	}
	public void setDbobjectname(String dbobjectname) {
		this.dbobjectname = dbobjectname;
	}

	@Column(unique=true, nullable=false, length=1)
	public String getMethodcode() {
		return this.methodcode;
	}
	public void setMethodcode(String methodcode) {
		this.methodcode = methodcode;
	}

	@Column(unique=true, nullable=false, length=30)
	public String getGroupname() {
		return this.groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DbobjsecurityPK)) {
			return false;
		}
		DbobjsecurityPK castOther = (DbobjsecurityPK)other;
		return 
			this.dbobjectname.equals(castOther.dbobjectname)
			&& this.methodcode.equals(castOther.methodcode)
			&& this.groupname.equals(castOther.groupname);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.dbobjectname.hashCode();
		hash = hash * prime + this.methodcode.hashCode();
		hash = hash * prime + this.groupname.hashCode();
		
		return hash;
    }
}